import Menu from "@ui/RJMart/menu";
import "@ui/RJMart/menu/menu.css";

export default function SideBar(props) {
    const [currentState, updateCurrentState] = React.useState({});

    let siderBarList = [
        {
            id: 211,
            name: "我的卡券"
        },
        {
            id: 211,
            name: "我的采购",
            childModel: [
                { id: 114, name: "我的采购单" },
                { id: 114, name: "课题组采购单" }
            ]
        },
        {
            id: 211,
            name: "订单管理",
            childModel: [
                { id: 114, name: "我的订单" },
                { id: 114, name: "课题组待结算单" }
            ]
        },{
            id: 211,
            name: "我的结算",
            childModel: [
                { id: 114, name: "我的待结算" },
                { id: 114, name: "课题组待结算" },
                { id: 114, name: "我的结算单" },
                { id: 114, name: "课题组结算单" }
            ]
        },{
            id: 211,
            name: "我的退货"
        },{
            id: 211,
            name: "我的竞价",
            childModel: [
                { id: 114, name: "新建竞价" },
                { id: 114, name: "竞价列表" }
            ]
        },{
            id: 211,
            name: "我的关注"
        },{
            id: 211,
            name: "我的评价"
        },{
            id: 211,
            name: "消息通知"
        },{
            id: 211,
            name: "我的设置",
            childModel: [
                { id: 114, name: "基本信息" },
                { id: 114, name: "实名认证" },
                { id: 114, name: "修改密码" },
                { id: 114, name: "收货地址" },
                { id: 114, name: "经费卡号" },
                { id: 114, name: "课题管理" }
            ]
        }
    ];

    return (
        <div className="zen_bg-FFFFFF rj_sidebar-wp">
            <Menu size="large" theme="theme-cyan" style={{ minWidth: "165px" }}>
                {siderBarList.map((item, index) => {
                    return item.childModel ? (
                        <Menu.SubMenu
                            key={Math.random().toString()}
                            title={item.name}
                        >
                            {item.childModel.map((it, i) => {
                                return (
                                    <Menu.Item key={Math.random().toString()}>
                                        {it.name}
                                    </Menu.Item>
                                );
                            })}
                        </Menu.SubMenu>
                    ) : (
                        <Menu.Item key={Math.random().toString()}>
                            {item.name}
                        </Menu.Item>
                    );
                })}
            </Menu>
        </div>
    );
}
